﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using VOL;
using BLL;
namespace WebShoes
{
    public partial class SanPhamForm : System.Web.UI.Page
    {
        HangHoaBL _HangHoaBL = new HangHoaBL();
        protected void Page_Load(object sender, EventArgs e)
        {
            HangHoa obj = new HangHoa();
            int _MaLoaiHangHoa = 0;
            int _MaNhaSanXuat = 0;
            int _MaChungLoai = 0;
            if (Request.QueryString["MaLoaiHangHoa"] != null)
            {
                int.TryParse(Request.QueryString["MaLoaiHangHoa"].ToString(), out _MaLoaiHangHoa);
            }
            if (Request.QueryString["MaNhaSanXuat"] != null)
            {
                int.TryParse(Request.QueryString["MaNhaSanXuat"].ToString(), out _MaNhaSanXuat);
            }
            if (Request.QueryString["MaChungLoai"] != null)
            {
                int.TryParse(Request.QueryString["MaChungLoai"].ToString(), out _MaChungLoai);
            }
            if (_MaLoaiHangHoa > 0)
            {
                obj.MaLoaiHangHoa = _MaLoaiHangHoa;
            }
            if (_MaNhaSanXuat > 0)
            {
                obj.MaNhaSanXuat = _MaNhaSanXuat;
            }
            if (_MaChungLoai > 0)
            {
                obj.MaChungLoai = _MaChungLoai;
            }
            DataTable dt = _HangHoaBL.GetData(obj);
            CollectionPager1.PageSize = 8;
            CollectionPager1.DataSource = dt.DefaultView;
            CollectionPager1.BindToControl = RepeaterProducts;
            RepeaterProducts.DataSource = CollectionPager1.DataSourcePaged;
        }
    }
}